home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: debug before main()
- Date: 7 Mar 96 12:26:02 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826201562@rscernix>
- References: <Pine.SOL.3.91.960305171701.17346B-100000@hamlet.uncg.edu>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <Pine.SOL.3.91.960305171701.17346B-100000@hamlet.uncg.edu> "QIAN . ZHONG" <q_zhong@hamlet.uncg.edu> writes:
-
- > What is the good way to debug the program before main(), I am using Borland
- >compiler, which generate a map file, and show the program entry point is
- >0000:0000, relative memory start point,
- >how to load the program and start debug from 0000:0000 ?
-
- Everything that happens before main() is called (in a C program, at least)
- is completely beyond your control and you have no business debugging that
- code. It is the startup code, for which no debugging information is
- normally available and all you can do is debug at assembly level. But
- since you can't change that code (unless you happen to have its source)
- what's the point in "debugging" it?
-
- In a C++ program constructors for global objects may be called before main().
- In such a case, set breakpoints at the beginning of the appropriate
- constructors, if you want to debug them.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-